package com.zhanghe.mall.util;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

/**
 * R
 *
 * @author Clevo
 * @date 2018/7/16
 */
public class R {

    Integer ret;
    String message;
    Object result;

    public R() {
        ret = 1;
    }

    public R(Integer ret) {
        this.ret = ret;
    }

    public R(String message) {
        ret = 1;
        this.message = message;
    }

    public R(Object result) {
        this.ret = 1;
        this.result = result;
    }

    public R(Integer ret, String message) {
        this.ret = ret;
        this.message = message;
    }

    public R(Integer ret, String message, Object result) {
        this.ret = ret;
        this.message = message;
        this.result = result;
    }

    public Integer getRet() {
        return ret;
    }

    public void setRet(Integer ret) {
        this.ret = ret;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    @Override
    public String toString() {
        Gson g = new Gson();
        return g.toJson(this);
    }
}
